{extend name="pc/user/layout"/}
{block name="main"}
   <div class="g-1400 g-container" id="pjax-container">
<div class="bg-bai b rx3">
    <div class="t-v t-t">
        <div class="c-sidebar c-sidebar-h pb5 br">
            <div class="c-sidebar-title t-v hui bb">代理后台</div>
            <ul class="c-nav click-nav">
                <li class="active"><a href="{:url('pc/index',['act'=>'daili'])}" class="t-v" data-pjax="">
                    <div><i class="icon icon-write"></i></div>
                    <div>代理后台</div>
                </a></li>
            </ul>
        </div>
        <div class="c-content bl">
            <div class="col-12 fl" style="min-height:420px;">
                <div class="g-title t-v pl4 bb">
                    <div class="col-12 h t-v bold">代理后台</div>
                </div>
                <div class="g-content h12 t-v bb">
					<div class="col-4 h9 t-v t-c br">我的余额：<font class="f5 hong mr2 userscore">{$userInfo.money}</font>元</div>
                    <div class="col-4 h9 t-v t-c br">代理等级：<font class="f5 hong mr2 qdhtmlday">{:is_daili($userInfo['dlpower'])}</font></div>
                    <div class="col-4 h9 t-v t-c">充值折扣：<font class="f5 hong mr2 userscore">{:config('sys_dl_give_z_'.$userInfo['dlpower'])}</font>折</div>
                </div>
				<div class="g-content p5">
					<div class="in-text" style="width:580px;">
						<dt class="bold pr4">充值UID：</dt>
						<dd><input type="number" class="form p0 h11 bb bb-hui" name="uid" placeholder="请输入需要充值的用户UID" value="" onkeypress="return x.ints(this,8,1);" autocomplete="off"></dd>
					</div><hr>
					<div class="in-text" style="width:580px;">
						<dt class="bold pr4">开通业务：</dt>
						<dd><select class="form w h8 bb" name="type">
										<option value="vip">VIP会员</option>
										<option value="peie">挂机配额</option>
									</select></dd>
					</div><hr>
					<div id="show_m1" style="display: inherit">
					<div class="t-v">
						<div class="bold pr3">开通时间：</div>
						<div>
							<label class="i-checks"><input type="radio" name="vip_ver" value="1" onclick="ajax_get(1,0);"><i></i>包月VIP - 1个月
												</label>
							<label class="i-checks ml5"><input type="radio" name="vip_ver" value="2" onclick="ajax_get(2,0);"><i></i>包季VIP - 3个月
												</label>
							<label class="i-checks ml5"><input type="radio" name="vip_ver" value="3" onclick="ajax_get(3,0);" checked=""><i></i>双季VIP - 6个月
												</label>
							<label class="i-checks ml5"><input type="radio" name="vip_ver" value="4" onclick="ajax_get(4,0);"><i></i>年费VIP - 12个月
												</label>
						</div>
					</div>
					</div>
					<div id="show_m2" style="display: none">
					<div class="t-v">
						<div class="bold pr3">购买数量：</div>
						<div>
							<label class="i-checks"><input type="radio" name="peie_ver" value="1" onclick="ajax_get(1,1);"><i></i>1个配额 - 永久
							</label>
							<label class="i-checks ml5"><input type="radio" name="peie_ver" value="2" onclick="ajax_get(2,1);" checked=""><i></i>3个配额 - 永久
							</label>
							<label class="i-checks ml5"><input type="radio" name="peie_ver" value="3" onclick="ajax_get(3,1);"><i></i>5个配额 - 永久
							</label> 
							<label class="i-checks ml5"><input type="radio" name="peie_ver" value="4" onclick="ajax_get(4,1);"><i></i>10个配额 - 永久
							</label></div>
					</div>
					</div>
					<hr/>
					<div class="h7" id="jiage">-</div>
					<hr>
					<div class="mt8 t-v">
						<div class="bold pr4">支付方式：</div>
						<div>
							<button class="btn btn-qing btn-md mr5 rx1" onclick="ajax_cz();">余额支付
							</button>
												</div>
					</div>
				</div>
            </div>
        </div>
    </div>
    <div class="c-pagination o-h t-v">
        <div class="c-sidebar"></div>
        <div class="c-content h11 o-h g-btn t-v bt bl">
            <div class="col-6 h t-v f3 hui pl5 pr5">提醒:发现充值后没有到账的情况,请快速联系站长QQ:{:config('web_user_qq')}</div>
        </div>
    </div>
</div>
   {/block}
   {block name='foot'}
 <script>
	function ajax_get(id,type) {
        x.ajax('{:url('daili_ajax/cz',['act'=>'price'])}', 'type='+ type +'&id=' + id);
    }

    function ajax_cz() {
        var uid = $("input[name='uid']").val(),
			vip_ver = $('input:radio[name="vip_ver"]:checked').val(),
			peie_ver = $('input:radio[name="peie_ver"]:checked').val(),
			type = $("select[name='type']").val();
		if (uid == '' || uid == undefined || uid == null) {
			x.msg('充值的用户UID不能为空');
		}else{
        x.ajax('{:url('daili_ajax/cz',['act'=>'cz'])}', '&vip_ver=' + vip_ver + '&peie_ver='+ peie_ver +'&type='+ type +'&uid='+ uid);
		}
    }

    $(function ($) {
        ajax_get(3,0);
    });
    $("select[name='type']").change(function () {
		if ($(this).val() == 'vip') {
			$("#show_m1").css("display", "inherit");
			$("#show_m2").css("display", "none");
			ajax_get(3,0);
		} else {
			$("#show_m1").css("display", "none");
			$("#show_m2").css("display", "inherit");
			ajax_get(2,1);
		}
	});
	if ($("select[name='type']").val() == 'vip') {
		$("#show_m1").css("display", "inherit");
		$("#show_m2").css("display", "none");
		ajax_get(3,0);
	}
	</script>
    {/block}